package com.wsx.java.boddy.interceptor;

import net.bytebuddy.implementation.bind.annotation.SuperCall;

import java.util.List;
import java.util.concurrent.Callable;

/**
 * @author wangshuaixin
 * @Title: com.wsx.java.boddy.interceptor.LoggingInteceptor
 * @Description: TODO
 * @date 2019/01/23
 */
public class LoggingInteceptor {

    public static List<String> log(@SuperCall Callable<List<String>> zuper) throws Exception {
        System.out.println("call memorydatabase");
        try {
            return zuper.call();
        } finally {
            System.out.println("get data from memeorydabase");
        }
    }
}
